package com.nattakute.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.nattakute.dao.ClassesDAO;
import com.nattakute.model.Classes;
import com.nattakute.service.ClassesService;

@Service("classesService")
@Transactional
public class ClassesServicesImpl implements ClassesService{

	@Autowired
	private ClassesDAO classesDAO;
	
	
	@Transactional
	@Cacheable("getAllClasses")
	public List<Classes> getAllClasses() {
		
		return classesDAO.getAllClasses();
	}

	
	@Transactional
	@Cacheable(value = { "getClassesById" })
	public Classes getClassesById(String id) {
		// TODO Auto-generated method stub
		return classesDAO.getClassesById(id);
	}

	
	@Transactional
	@Cacheable(value = { "addClasses" })
	public Boolean addClasses(Classes classes) {
		// TODO Auto-generated method stub
		return classesDAO.addClasses(classes);
	}

	
	@Transactional
	@Cacheable(value = { "deleteClasses" })
	public Boolean deleteClasses(Classes classes) {
		// TODO Auto-generated method stub
		return classesDAO.deleteClasses(classes);
	}

	
	@Transactional
	@Cacheable(value = { "updateClasses" })
	public Boolean updateClasses(Classes classes) {
		// TODO Auto-generated method stub
		return classesDAO.updateClasses(classes);
	}

	
	@Transactional
	@Cacheable(value = { "getClassesByDepartmentId" })
	public List<Classes> getClassesByDepartmentId(String id) {
		// TODO Auto-generated method stub
		return classesDAO.getClassesByDepartmentId(id);
	}

	
	@Transactional
	@Cacheable(value = { "getClassesByName" })
	public List<Classes> getClassesByName(String name) {
		// TODO Auto-generated method stub
		return classesDAO.getClassesByName(name);
	}



	public void setClassesDAO(ClassesDAO classesDAO) {
		this.classesDAO = classesDAO;
	}

	
	
}
